package org.example.Day4.lambda;

import org.example.Day3.niming.Swimming;

public class lambdatest1 {
    public static void main(String[] args){
        //创建匿名内部类
        Swimming s = new Swimming() {
            @Override
            public void swim() {
                System.out.println("学生快乐 游泳");
            }
        };
        s.swim(); 
        //使用lambda对匿名内部类进行简化
        Swimming s1 = () ->{
            System.out.println("学生快乐游泳");

        };
        s1.swim();
    }
}
